﻿using BusinessTier;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace FlightWCFService
{
   
    public class FlightService : IFlightService
    {
        public String Book(List<int> legIDS, List<Backend.Passenger> passengers)
        {
            FlightBooking booking = FlightBooking.GetFlightBookingObj();

            return booking.Book(legIDS, passengers);
        }




        //public List<string> flightSearch(string departAirp, string arrivalAirp, string date)
        //{
        //    List<String> flight = new List<String>();
        //    flight.Add("ID:123");
        //    flight.Add("From:CPH");
        //    flight.Add("To:AAL");
        //    flight.Add("Cost: 200$");
        //    flight.Add("ID:321");
        //    flight.Add("From:AAL");
        //    flight.Add("To:NYC");
        //    flight.Add("Cost: 1200$");

        //    return flight;

        //}


        public String SayHello()
        {
            FlightBooking booking = FlightBooking.GetFlightBookingObj();
           return booking.SayHelloTest();
        }







        //Returns null if no flights were found
        public System.Collections.Generic.List<Backend.Flight> FlightSearch(string departAirp, string arrivalAirp, string date, int numberOfPassengers)
        {
            FlightBooking booking = FlightBooking.GetFlightBookingObj();

            return booking.FlightSearch(new Backend.Airport(departAirp), new Backend.Airport(arrivalAirp), date, numberOfPassengers);
        }
    }
}
